<?php

//Array ( [username] => gg [sex] => 男 [message] => ggggg [imgurl] => images/2.jpg )
/*
 * 
 * 
 * 
 * INSERT INTO  `bbs_1`.`n1` (
`id` ,
`username` ,
`sex` ,
`imgurl` ,
`content` ,
`m_date`
)
VALUES (
NULL ,  '',  '',  '',  '',  ''
);

[ 编辑 ] [ 创建 PHP 代码 ]



 */

header("content-type:text/html;charset=utf-8");

require_once '20161010_1.php';

//print_r($_POST);
//die;

$username = $_POST["username"];
$sex = $_POST["sex"];
$content = $_POST["message"];
$imgurl = $_POST["imgurl"];
$time_at = time();

$sql = "
INSERT INTO `bbs_1`.`n1` (`id`, `username`, `sex`, `imgurl`, `content`, `m_date`) VALUES 
(NULL,  '$username',  '$sex',  '$imgurl',  '$content','$time_at');   

";

///echo $sql;
//die;

//die;

//$result = $conn->query($sql);
//print_r($result);
//die;

//$url = "index.php";
//header("Location:$url");
//exit;
  

$result = $conn->query($sql);
if ($result === false){
    echo '0';
} 
    header("Location:index.php");




  
 






?>